/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package UIClass;

import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

/**
 *
 * @author paintbsd
 */
public class ImageView extends JLabel implements MouseListener {
    private ArrayList<ImageView>arr;
    private boolean stateClick;
    public ImageView(ImageIcon img,ArrayList<ImageView>arr1) {
        super(img);
        addMouseListener(this);
        this.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY,1));
        arr=arr1;
        stateClick=false;
    }

    public void setBound(int x,int y,int width,int height) {
        this.setBound(x, y, width, height);
    }

@Override
public void mouseClicked(MouseEvent e) {
//YOUR RESPONSE HERE
    if(stateClick==false)
        this.setBorder(BorderFactory.createLineBorder(Color.BLUE,2));
    else
        this.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY,1));
    stateClick=!stateClick;
}

@Override
public void mousePressed(MouseEvent e) {}
@Override
public void mouseReleased(MouseEvent e) {}
@Override
public void mouseExited(MouseEvent e) {}
@Override
public void mouseEntered(MouseEvent e) {}


}
